package com.zengqingfa.designpattern.behavior.template.common;

/**
 *
 * @fileName: Client
 * @author: zengqf3
 * @date: 2021-4-9 15:24
 * @description:
 */
public class Client {

    public static void main(String[] args) {
        AbstractTemplate template1 = new ConcreteTemplate1();
        template1.templateMethod();

        AbstractTemplate template2 = new ConcreteTemplate2();
        template2.templateMethod();

        //匿名内部类的形式
        AbstractTemplate template3 = new AbstractTemplate() {
            @Override
            protected void abstractMethod() {
                System.out.println("template3 abstractMethod");
            }
        };
        template3.templateMethod();
    }
}
